<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<head>
<title>单位管理--${fns:getConfig('productName')}</title>
<%@ include file="/common/treetable.jsp"%>
<script type="text/javascript">
$(document).ready(function() {
	$("#treeTable").treeTable({expandLevel : 3});
});
</script>
</head>
<body>
	<ul class="nav nav-tabs" style="margin:0 4px 4px 4px;">
		<li class="active"><a href="${ctx}/organization/list.do?top=${fns:encodeParam(top)}&left=${fns:encodeParam(left)}">
			<i class="icon icon-list"></i>&nbsp;<span>单位列表</span></a></li>
			<sec:authorize ifAnyGranted="ROLE_sys_org_edit">
		<li><a href="${ctx}/organization/input.do?top=${fns:encodeParam(top)}&left=${fns:encodeParam(left)}">
		     <i class="icon icon-edit"></i>&nbsp;<span>单位添加</span></a></li>
		     </sec:authorize>
	</ul>
	<div  class="form-horizontal container" style="width:auto;">
	<tags:message content="${msg}"/>
	<table id="treeTable" style="width:100%;" class="table table-striped table-hover table-bordered table-condensed">
		<tr>
			<th>单位名称</th>
			<!-- 
			<th>简称</th>
			<th>类型</th>
			<th>角色</th> -->
			<th>负责区域</th>
			<th>负责人</th>
			<th>联系电话</th>
			<th>分管领导</th>
			<th>分管领导电话</th>
			<th>地址</th>
			<th>操作</th>
		</tr>
		<c:forEach items="${list}" var="org">
			<tr id="${org.id}" pId="${org.parent.id ne topId?org.parent.id:'0'}">
				<td>${org.orgName}</td>
				<!--
				<td>${org.shortName}</td>
				<td><pt:code category="2003" code="${org.orgForm}"></pt:code></td>
				<td><pt:code category="2004" code="${org.type}"></pt:code></td>
				  -->
				<td><pt:code category="2002" code="${org.district}" multiple="true"></pt:code></td>
				<td>${org.principal}</td>
				<td>${org.orgTelephone}</td>
				<td>${org.principal}</td>
				<td>${org.orgTelephone}</td>
				<td>${org.orgAddress}</td>
				<td class="the_icons">
				<sec:authorize ifAnyGranted="ROLE_sys_org_edit">
				    <a href="${ctx}/organization/input.do?id=${org.id}&top=${fns:encodeParam(top)}&left=${fns:encodeParam(left)}" title="修改"><i class="icon icon-edit"></i></a>
					<a href="${ctx}/organization/delete.do?id=${org.id}&top=${fns:encodeParam(top)}&left=${fns:encodeParam(left)}" onclick="return confirm('要删除该单位及所有子单位项吗？', this.href)" title="删除"><i class="icon icon-remove"></i></a>
					<a href="${ctx}/organization/input.do?parentId=${org.id}&top=${fns:encodeParam(top)}&left=${fns:encodeParam(left)}" title="添加下级单位"><i class="icon icon-tasks"></i></a>
				</sec:authorize> 
				</td>
			</tr>
		</c:forEach>
	</table>
	</div>
</body>
</html>